//
//  LTView.m
//  UI03_UIViewController_CustomView
//
//  Created by Scott on 16/3/11.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "LTView.h"

@interface LTView ()

@end

@implementation LTView

- (void)dealloc {
    [_labelOfLeft release];
    [_textFieldOfRight release];
    [super dealloc];
}

#pragma mark - Creating and Init
- (instancetype)initWithFrame:(CGRect)frame {
    
    return [self initWithFrame:frame withText:nil placeHolder:nil];
    
}

- (instancetype)initWithFrame:(CGRect)frame withText:(NSString *)text placeHolder:(NSString *)placeHolder {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubViewsWithFrame:frame];
        
        self.labelOfLeft.text = text;
        self.textFieldOfRight.placeholder = placeHolder;
    }
    return self;
}


#pragma mark -
- (void)createSubViewsWithFrame:(CGRect)frame {
    
    self.labelOfLeft = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width / 3, frame.size.height)];
    [self addSubview:self.labelOfLeft];
    [_labelOfLeft release];
    
    
    self.textFieldOfRight = [[UITextField alloc] initWithFrame:CGRectMake(frame.size.width / 3, 0, frame.size.width * 2 / 3, frame.size.height)];
    [self addSubview:self.textFieldOfRight];
    [_textFieldOfRight release];
    
    self.textFieldOfRight.borderStyle = 3;
    
}




@end
